package src;

import src.LT;

import java.text.NumberFormat;
import java.util.*;
public class Calculate {
    public static void main(String[] args) {
        double p = 0;
        NumberFormat number = NumberFormat.getPercentInstance();
        Random ran = new Random();
        Scanner scan = new Scanner(System.in);
                                //A:题目数量
        System.out.print("请输入您所需要生成的题目难度：");
        int C = scan.nextInt();//C:题目难度
        String D ="y";
        while (D=="y") {
            int I=1;
            LT lt = new LT();
            CD Y = new CD();
            Calculate A = new Calculate();
            String str = Y.cd(C);
            List<String> list = lt.work(str);
            List<String> list2 = lt.InfixToPostfix(list);
            System.out.println("原式为："+str);
            System.out.print("后缀表达式为：");
            lt.printList(list2);

            I++;
            double T = (double) Judgement.getTrues() / I;
            p = T;

            System.out.println("是否继续生成题目？（y/n）:"  );
            String s1 = scan.next();
            if (s1.equalsIgnoreCase("n")){
                D ="n";


            }
        }
        System.out.println("你答对的题目总数：" +  Judgement.getTrues());
    }
    public int Resule(String A)
    {
        int B =Integer.parseInt(A);
        return B;
    }

}
